$(document).ready(function() {
	$('#normalDiscount').click(function() {

		$('#discountLabel').add('#discount').css('display', 'block');

	});
	$('#easterDiscount').add('#christmasDiscount').click(function() {

		$('#discountLabel').add('#discount').css('display', 'none');

	});
	Validation.hideOnFocus('#productPrice', '#dicountRequired');

	$("#discountedPrice").submit(function() {
		var initalPrice = $('#productPrice').val();
		var normalDiscount = $('#discount').val();

		if (Validation.empty(initalPrice, "#dicountRequired"))
			return false;

		if ($('#normalDiscount').attr('checked')) {

			var finalPrice = DiscountFunctions.discountedPrice(initalPrice, normalDiscount);

		} else if ($('#easterDiscount').attr('checked')) {

			var finalPrice = DiscountFunctions.easterPrice(initalPrice);

		} else if ($('#christmasDiscount').attr('checked')) {

			var finalPrice = DiscountFunctions.christmasPrice(initalPrice);

		}
		var finalPrice = finalPrice.toFixed(2);

		$('span#finalPrice').html(finalPrice);
		return false;
	});

});
